package com.chenshu.controller;

import com.chenshu.domain.Point;
import com.chenshu.domain.Window;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Date;

/**
 * Created with IntelliJ IDEA
 * Description
 * User：chenshu
 * Date：2024-04-27
 * Time：20:35
 */
@Controller
public class WindowController {

    @RequestMapping(value = "/window")
    public String addWindow(Point point, HttpServletRequest request) {
        System.out.println(point);
        Window window = new Window();
        window.setPoint(point);
        window.setCreateTime(new Date());
        request.setAttribute("window", window);
        return "success";
    }
}
